﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace WebApplication1
{
    public class CaseFight : Case
    {
        protected Random rand = new Random();
        public void declencherEffet(Map m)
        {            
            int choixAdv = rand.Next(100);
            int lvladv;
            if(choixAdv < 10)
                lvladv = m.vaisseau.lvl - 2;
            else if(choixAdv < 30)
                lvladv = m.vaisseau.lvl - 1;
            else if(choixAdv < 80)
                lvladv = m.vaisseau.lvl;
            else if(choixAdv < 95)
                lvladv = m.vaisseau.lvl + 1;
            else
                lvladv = m.vaisseau.lvl + 2;

            m.vaisseau.fight(lvladv);
        }
    }
}
